package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Role;
import com.wiscamp.ninechapters.panels.infrastructure.po.RolePO;
import com.wiscamp.ninechapters.panels.infrastructure.views.RoleView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface RoleConverter {
    RoleConverter Instance = Mappers.getMapper(RoleConverter.class);

    Role toRole(RolePO po);

    Role toRoleByView(RoleView view);

    RolePO toRolePO(Role entity);

    RolePO toRolePO(Role entity, @MappingTarget RolePO po);

}
